import 'package:dio/dio.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/src/simple/get_controllers.dart';
import '../../../../../bean/KeyValueBean.dart';
class EmployerPage_SalarySystemSelectController extends GetxController {
  RxList<KeyValueBean> list_xz = <KeyValueBean>[].obs;
  int select_index = -1;

  EmployerPage_SalarySystemSelectController() {
    initData();
  }

  void initData() {
    list_xz.add(KeyValueBean.keyValue(key: "0", value: "12新", ui_select_view_data: 0));
    // list_xz.add(KeyValueBean("1", "13新", 0));
    // list_xz.add(KeyValueBean("2", "14新", 0));
    // list_xz.add(KeyValueBean("3", "15新", 0));
    // list_xz.add(KeyValueBean("4", "16新", 0));
    // list_xz.add(KeyValueBean("5", "17新", 0));
    // list_xz.add(KeyValueBean("6", "18新", 0));
    // list_xz.add(KeyValueBean("7", "19新", 0));
  }

  void clearData() {
    list_xz.forEach((v) {
      v.ui_select_view_data = 0;
    });
    list_xz.refresh();
  }

  void select(int index) {
    if (select_index == -1) {
      select_index = index;
      list_xz[select_index].ui_select_view_data = 1;
    } else {
      list_xz[select_index].ui_select_view_data = 0;
      select_index = index;
      list_xz[select_index].ui_select_view_data = 1;
    }
    list_xz.refresh();
  }
  KeyValueBean? getSelect(){
    if(select_index==-1){
      return null;
    }
    return list_xz[select_index];
  }
}
